﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdTtfDescriptor : IDisposable
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdTtfDescriptor(IntPtr cPtr, bool cMemoryOwn)
		{
			this.swigCMemOwn = cMemoryOwn;
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdTtfDescriptor obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdTtfDescriptor()
		{
			this.Dispose();
		}

		public virtual void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdTtfDescriptor(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
		}

		public OdTtfDescriptor() : this(GlobalsPINVOKE.new_OdTtfDescriptor__SWIG_0(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdTtfDescriptor(string typeface, bool bold, bool italic, int charset, int pitchAndFamily) : this(GlobalsPINVOKE.new_OdTtfDescriptor__SWIG_1(typeface, bold, italic, charset, pitchAndFamily), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public string fileName()
		{
			string result = GlobalsPINVOKE.OdTtfDescriptor_fileName(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public string typeface()
		{
			string result = GlobalsPINVOKE.OdTtfDescriptor_typeface(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void clearFileName()
		{
			GlobalsPINVOKE.OdTtfDescriptor_clearFileName(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void clearTypeface()
		{
			GlobalsPINVOKE.OdTtfDescriptor_clearTypeface(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void addTypeface(char typeface)
		{
			GlobalsPINVOKE.OdTtfDescriptor_addTypeface(this.swigCPtr, typeface);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setFileName(string filename)
		{
			GlobalsPINVOKE.OdTtfDescriptor_setFileName(this.swigCPtr, filename);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setTypeFace(string typeface)
		{
			GlobalsPINVOKE.OdTtfDescriptor_setTypeFace(this.swigCPtr, typeface);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setTtfFlags(uint flags)
		{
			GlobalsPINVOKE.OdTtfDescriptor_setTtfFlags__SWIG_0(this.swigCPtr, flags);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setTtfFlags(bool bold, bool italic, int charset, int pitchAndFamily)
		{
			GlobalsPINVOKE.OdTtfDescriptor_setTtfFlags__SWIG_1(this.swigCPtr, bold, italic, charset, pitchAndFamily);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setBold(bool bold)
		{
			GlobalsPINVOKE.OdTtfDescriptor_setBold(this.swigCPtr, bold);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setItalic(bool italic)
		{
			GlobalsPINVOKE.OdTtfDescriptor_setItalic(this.swigCPtr, italic);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setCharSet(int charset)
		{
			GlobalsPINVOKE.OdTtfDescriptor_setCharSet(this.swigCPtr, charset);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setPitchAndFamily(int pitchAndFamily)
		{
			GlobalsPINVOKE.OdTtfDescriptor_setPitchAndFamily(this.swigCPtr, pitchAndFamily);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool isBold()
		{
			bool result = GlobalsPINVOKE.OdTtfDescriptor_isBold(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isItalic()
		{
			bool result = GlobalsPINVOKE.OdTtfDescriptor_isItalic(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public ushort charSet()
		{
			ushort result = GlobalsPINVOKE.OdTtfDescriptor_charSet(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public int pitchAndFamily()
		{
			int result = GlobalsPINVOKE.OdTtfDescriptor_pitchAndFamily(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public int getPitch()
		{
			int result = GlobalsPINVOKE.OdTtfDescriptor_getPitch(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public int getFamily()
		{
			int result = GlobalsPINVOKE.OdTtfDescriptor_getFamily(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		protected bool swigCMemOwn;
	}
}
